#include "../FastDDSDataType/TestData.h"
#include "HelloWorldPublisher.h"
#include "HelloWorldSubscriber.h"
#include "../FastDDSDataType/TestArray.h"

HelloWorldPublisher pub;
HelloWorldSubscriber sub;

extern "C" __declspec(dllexport) void InitPub() {
	pub.init();
}

extern "C" __declspec(dllexport) void InitSub() {
	sub.init();
}

extern "C" __declspec(dllexport) void Send(const char* str1,const char* str2) {
	TestString data_;
	data_.str1(str1);
	data_.str2(str2);

	//data_.str1(data->str1);
	//data_.str2(data->str2);

	/*std::cout << data_.str1().size() << '\n';
	std::cout << data_.str1().capacity() << '\n';
	std::cout << data_.str1().max_size() << '\n';*/

	pub.publish(&data_);
}


extern "C" __declspec(dllexport) void Send2(TestData* data) {
	TestString data_;
	data_.str1(data->str1);
	data_.str2(data->str2);
	pub.publish2(&data_);
}


extern "C" __declspec(dllexport) void SendArr(char* data) {
	//pub.pubArray(data);
}